﻿using System.Collections.Generic;
using System.Data;
using System.Data.Common;

namespace DBCore.DB
{
     public interface IDAO
    {
        string ConnectString { get; set; }
        string TableName { get; set; }
        int Add(DbParam[] modelparam);
        int AddRange(List<DbParam[]> modelparam);
        int Update(DbParam[] modelparam, DbParam pk);
        int DeleteByWhere(SqlParam where);
        int DeleteByKey(DbParam pk);
        bool Exists(SqlParam where);
        int Count(SqlParam where);
        DataSet GetDataSet(int topn, string columns, SqlParam where, string ordreby);
        DataSet GetDataSetByGroup(int topn, string columns, SqlParam where, string orderby, string groupby);
        DataSet GetJoinDataSet(int topn, string columns, SqlParam where, string orderby, string JoinTableName, string on);
        KeyValuePair<DataSet, int> GetPageDateSet(int page, int pagesize, SqlParam where, string columns, string ordreby, string pk);
        KeyValuePair<DataSet, int> GetJoinPageDateSet(int page, int pagesize, string columns,  SqlParam where, string ordreby,string tablename,string on);
        string GetDetail(DbParam db);
    }
}
